<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			.box{
				width: 600px;
				display: flex;
				text-align: center;
				margin: auto;
				border: 1px solid;
			}
			.box .b{
				width: 120px;
				line-height: 100px;
				text-align: center;
				border: 1px solid;
			}
		</style>
	</head>
	<body>
		<div class="box">
			<div class="b"></div>
			<div class="b"></div>
			<div class="b"></div>
			<div class="b"></div>
			<div class="b"></div>
		</div>
		
		<script type="text/javascript">
			var b = document.getElementsByClassName("b")
			var time = new Date('2020-10-16 00:00:00')
			
			var daojishi = setInterval(function(){
				var localtime = new Date()
				var times = time - localtime
				var ms = times%1000
				var sec = parseInt(times/1000)
				var s = sec%60
				var m = parseInt((sec/60)) % 60
				var h = parseInt((sec/3600))%24
				var day = parseInt((sec/86400))%365
				b[0].innerHTML = day + '天'
				b[1].innerHTML = h + '时'
				b[2].innerHTML = m + '分'
				b[3].innerHTML = s + '秒'
				var res = '';
				if(ms < 10){
					res = "00" + ms;
				}else if(ms >= 10 && ms < 100){
					res = "0" + ms;
				}else{
					res = ms;
				}
				b[4].innerHTML = res + '毫秒';
				
			},1)
		</script>
	</body>
</html>
